1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

Mark Meyer | Parametric surfaces | circles curve steady point

markmeyer-parametric6b
size(550, 550)
colormode(HSB)
background(0.2, 0.02, 0.2)
fill(0.6, 0.1, 0.2, 0.005)
stroke(0.2, 0.1, 0.8, 0.7)
strokewidth(.25)
 
from math import sin, cos
def circle_equation(r, dt):
    center_x = 0.0
    center_y = 0.0
    t = 0.0
    while True:
        x = center_x + sin(t) * r
        y = center_y + cos(t) * r
        yield x, y
        t += dt
 
eq1 = circle_equation(250, 4 )
eq2 = circle_equation(400, -4)
x1, y1 = eq1.next()
x2, y2 = eq2.next()
 
translate(WIDTH/2, HEIGHT/2)
autoclosepath(False)
for i in range(360):
    beginpath(-60, 0)
    curveto(x1, y1, x2, y2, 60, 0)
    x1, y1 = eq1.next()
    x2, y2 = eq2.next()
    curveto(x2, y2, x1, y1, 0, -20)
    x1, y1 = eq1.next()
    x2, y2 = eq2.next()
    curveto(x1, y1, x2, y2, -60, 0)
    endpath()